<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
<script type="text/javascript">
jQuery(document).ready(function(){
	jQuery("#sm").append("<input type='button' class='e8_btn_top_first' value='扫码' onclick='sm();'>");
});

function sm(){
	showDialog("/jobs/baicheng/sm_list.jsp");
}

var dialog = null;
function showDialog(url){
	var sheight = screen.height;
	var swidth = screen.width;
	var diaHeight = sheight*0.9;
	var diaWidth = swidth*0.8;
	
   	dialog = new top.Dialog();
   	dialog.currentWindow = window;
   	dialog.Drag = true;
   	dialog.Width = diaWidth;
   	dialog.Height = diaHeight;
   	dialog.callbackfun = function(callbackfunParam, _data){
	   	window.location.reload();
    }
    dialog.closeA = function(res){
	   	var requestArr = res.split(",");
	   	for(var i=0; i<requestArr.length; i++){
	   		addRow0(0);
	   		var rowindex = jQuery("input[name='check_node_0']").last().val();
	   		jQuery("#field20966_"+rowindex).val(requestArr[i]);
	   	}
    }
    dialog.cancelLabel = "关闭";//关闭
	dialog.okLabel = "保存";//保存
	dialog.OKEvent = function () {
	 	var iframe = top.$("#_DialogBGDiv").prev("div").find("iframe");
	 	if(iframe.length==0){
	 		iframe = top.$("#_DialogBGDiv").next("div").find("iframe");
	 	}
	 	var win = iframe.get(0).contentWindow;
	 	if(win.doOK){
	 		var batchRequestid = win.doOK();
	 		var requestArr = batchRequestid.split(",");
		   	for(var i=0; i<requestArr.length; i++){
		   		addRow0(0);
		   		var rowindex = jQuery("input[name='check_node_0']").last().val();
		   		jQuery("#field20966_"+rowindex).val(requestArr[i]);
		   	}
		   	dialog.close();
	 	}
	};
   	dialog.URL = url;
	dialog.show();
}
</script>
  </head>
</html>
